<%@page import="java.text.NumberFormat"%>
<%@page import="models.Domain"%>
<%@page import="com.googlecode.objectify.Query"%>
<%@page import="controller.Utils"%>
<%
Query<Domain> list = (Query<Domain>) request.getAttribute("list");
String ip = (String) request.getAttribute("ip");
NumberFormat nf = NumberFormat.getInstance();

String title = "Lookup Ip "+ip;
String description = "Ip "+ip +" "+ Utils.ValidDomain()+" - search, ip lookup information on  "+Utils.ValidDomain();
String keywords = ip+",ip,ip address,lookup ip";
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>"/>
	<jsp:param name="description" value="<%=description %>"/>
	<jsp:param name="keywords" value="<%=keywords %>"/>
</jsp:include>

		<div id="mainContent">
            	<div class="adv-1 content-center">
                	<%@ include file='/adv/banner.jsp'%>
                </div>
                <div id="leftSideContent">
                	<div id="ipPage">
                        <h1 class="title">Lookup Ip : <%=ip %></h1>
                        <section class="blockContent blockBlue">
                        	<h3 class="title">Domain same ip <%=ip %></h3>
                            <ul class="infoDetail">
                            	<li>
                                	<%@ include file='/adv/note.jsp'%>
                                </li>
                            	<li class="clearafter">
                                	<%
									String string = "";
									
									string += "<table class='table' cellpadding=\"0\" cellspacing=\"0\">";
									string += "<tr>";
									string += "<th class='text_left'>";
									string += "Domain";
									string += "</th>";
									string += "<th>";
									string += "Speed site";
									string += "</th>";
									string += "<th>";
									string += "Google pagerank";
									string += "</th>";
									string += "<th>";
									string += "Alexa rank";
									string += "</th>";
									string += "</tr>";
									if(list.count()>0)
				        		 	{
				        		 		for (Domain ar: list) {
											string += "<tr>";
											string += "<td class='text_left'>";
											string += "<a href='/domain/"+ar.getDomain()+"'>"+ar.getDomain()+"</a>";
											string += "</td>";
											string += "<td>";
											string += ar.getSpeed()!=null?"<b>"+ar.getSpeed()+"</b>"+" Seconds":"-";
											string += "</td>";
											string += "<td>";
											string += ar.getGooglepr()!=null?ar.getGooglepr():"-";
											string += "</td>";
											string += "<td>";
											string += ar.getAlexa()!=0?nf.format(ar.getAlexa()):"-";
											string += "</td>";
											string += "</tr>";
				        		 		}
									}
									string += "</table>";
									out.print(string);
									%>
                                </li>               
                            </ul>
                        </section>   
                        <section class="blockContent blockBlue">
                        	<h3 class="title">Whois ip <%=ip %></h3>
                            <ul class="infoDetail" style="overflow: auto;">
                            	<li>
                            		<%
									if(list.count()>0)
				        		 	{
				        		 		for (Domain ar: list) {
				        		 			if(ar.getWhoisIp()!=null)
				        		 				out.print(ar.getWhoisIp().getValue());
				        		 			break;
				        		 		}
				        		 	}
									%>
                            	</li>
                            </ul>
                        </section>                     
                    </div>
                </div>
                <aside id="rightSideContent">
                	<div class="simpleBox box-blue">
                    	<ul id="sideMenu">
                        	<li><a href="/">Home</a></li>
                            <li><a href="/whois">Whois</a></li>
                            <li><a href="http://www.prapi.net" rel="nofollow">Pagerank</a></li>
                            <li><a href="/myip">Myip</a></li>
                            <li><a href="/contact">Contact us</a></li>
                        </ul>
                    </div>
                	<div><%@ include file='/adv/right.jsp'%></div>
                    
                </aside>
                <div class="clearbreak"></div>
            </div>


		
<%@ include file='/layout/footer.jsp'%>